import { ResPage, ReqPage } from '@/api/interface'
import { TBY } from '@/api/config/servicePort'
import http from '@/api'

/**解放碑 */
export namespace EducationStele {
  export interface Query extends ReqPage {
    name?: string
  }

  export interface Record {
    /**主键id */
    id: number
    /**名称*/
    name: string
    /**经度*/
    longitude: string
    /**维度*/
    latitude: number
  }

  export interface Form {
    /**主键id */
    id: number
    /**名称*/
    name: string
    /**经度*/
    longitude: string
    /**维度*/
    latitude: number
  }
}

export const pageEducationStele = (params: EducationStele.Query) => {
  return http.get<ResPage<EducationStele.Record>>(TBY + `/education_stele/page`, params)
}

// 山峰详情
export const getEducationSteleDetail = (id: number) => {
  return http.get<Partial<EducationStele.Form>>(TBY + `/education_stele/get`, { id }, { loading: false })
}

// 新增或修改山峰
export const saveOrUpdateEducationStele = (params: Partial<EducationStele.Form>) => {
  return http.post(TBY + `/education_stele/save`, params)
}

// 删除山峰
export const removeEducationStele = (id: number) => {
  return http.delete(TBY + `/education_stele/delete`, { id })
}
